package com.yuanfeng.order.feign;

import com.yuanfeng.commoms.dto.base.MemberMessageListIntegralDTO;
import com.yuanfeng.commoms.dto.userms.UserTokenBeanDTO;
import com.yuanfeng.commoms.util.ResponseResult;
import com.yuanfeng.commoms.vo.fx.VkApplyOrderVO;
import com.yuanfeng.commoms.vo.user.UserInfoVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author Stranger
 * @date 2023/3/20 11:30
 */
@FeignClient(name = "mall-userms", url = "http://localhost:8081")
public interface UserServiceClient {

    /**
     * 查找用户权限
     *
     * @param param
     * @return
     */
    @PostMapping("/user/businessInfo/queryUserPermissions")
    ResponseResult queryUserPermissions(@RequestBody UserTokenBeanDTO param);

    /**
     * 查询当前用户的plus 会员信息 feign
     */
    @PostMapping("user/plusInfo/queryUserPlusInfo")
    public ResponseResult queryUserPlusInfo(@RequestParam("userId") String userId);

    /**
     * 根据参数查用户信息
     *
     * @return
     */
    @PostMapping("/user/ms/queryUserInfo")
    ResponseResult queryUserInfo(@RequestBody UserInfoVO userInfoVO);


    /**
     * 根据userId获取用户信息
     *
     * @param userId
     * @return 结果
     */
    @GetMapping("/user/ms/queryUserInfoByUserId")
    ResponseResult queryUserInfoByUserId(@RequestParam("userId") String userId);

    /**
     * 根据用户id查询用户积分
     * @param userId
     * @return
     */
    @PostMapping("/user/ms/getMemberIntegralByUserId")
    Integer getMemberIntegralByUserId(@RequestParam("userId") String userId);

    /**
     * 更新plus信息表已用额度
     * @param hashMap
     * @return
     */
    @PostMapping("user/plusInfo/updateUserPluslimit")
    ResponseResult updateUserPluslimit(@RequestBody HashMap<Object, Object> hashMap);

    /**
     * 查询用户微客信息
     * @param paraMap
     * @return
     */
    @PostMapping("userVk/queryVKUserInfo")
    public ResponseResult queryVKUserInfo(@RequestBody Map<String, String> paraMap);

    /**
     * 商品分享记录
     * @param data
     * @return
     */
    @PostMapping(value = "userVk/shareGoodsRecord")
    public ResponseResult shareGoodsRecord(@RequestBody String data);

    /**
     *  第一次购买用户成为店铺会员
     * @param data
     * @return
     */
    @PostMapping(value = "userVk/addShopVipUser")
    ResponseResult addShopVipUser(@RequestBody String data);

    /**
     * 微客申请购买商品
     * @param data
     * @return
     */
    @PostMapping(value = "userVk/vkApply")
    ResponseResult vkApply(@RequestBody Map<String,List<VkApplyOrderVO>> data);

    /**
     * 修改用户积分
     *
     * @param param
     * @return
     */
    @PostMapping("/user/ms/updateMemberIntegral")
    ResponseResult updateMemberIntegral(@RequestBody MemberMessageListIntegralDTO param);

    /**
     * 增加用户积分
     *
     * @return
     */
    @PostMapping("/user/pointsLog/insertByMap")
    ResponseResult insertPointLogByMap(@RequestBody Map<String, Object> map);


    /**
     * 根据shopId查询卖家信息
     *
     * @param returnMap
     * @return
     */
    @PostMapping("/user/sellerBase/info")
    ResponseResult getSellerInfo(@RequestBody Map<String, String> returnMap);

    /**
     * 根据管理员找到企业
     *
     * @param userId
     * @return
     */
    @GetMapping("/user/businessInfo/queryBusiness")
    ResponseResult queryBusiness(@RequestParam("userId") String userId);

    /**
     * 查询员工列表
     *
     * @param businessId
     * @return
     */
    @GetMapping("/user/businessEmployee/queryEmployeesList")
    List<String> queryEmployeesList(@RequestParam("businessId") String businessId);

    /**
     * 根判断是否为未通过企业用户
     *
     * @param map
     * @return
     */
    @PostMapping("/user/businessInfo/infoByMap")
    ResponseResult getBusinessInfoByMap(@RequestBody Map<String, String> map);

    /**
     * 查询会员权益
     *
     * @param id
     * @return
     */
    @PostMapping("/user/plusEquity/query")
    ResponseResult selectplusequitys(@RequestBody List<Integer> id);

}
